<div class="yf-full">
	<!-- 删除 -->
	<div class="yf-del-window">
		<div class="yf-del-box">
			<div class="yf-del-title">
				提示<span class="yf-del-close yf-del-hide">&times;</span>
			</div>
			<div class="yf-del-content">
				确定删除所有提示信息？
			</div>
			<div class="yf-del-btn-t">
				<a class="yf-del-btn-y">确定</a><a class="yf-del-btn-n">取消</a>
			</div>
		</div>
	</div>
	
	<div class="yf-letter-window">
		<div class="yf-letter-title">
			写站内信<span class="yf-del-close yf-letter-hide">&times;</span>
		</div>
		<div class="yf-letter-form">
			<form class="ajaxForm" action="__WEBURL__/user/index/writemsg" method="post">
				<div class="yf-letter-input">
					<label>收件人</label>
					<div class="yf-form-control">
						<input type="text" class="yf-input" value="烘焙圈" readonly placeholder="发送内信，就@烘培圈吧">
					</div>
				</div>
				<div class="yf-letter-input">
					<label>主题</label>
					<div class="yf-form-control">
						<input type="text" class="yf-input" name="title" placeholder="必填">
					</div>
				</div>
				<div class="yf-letter-input">
					<label>内容</label>
					<div class="yf-form-control">
						<textarea name="content" class="yf-input" placeholder="必填"></textarea>
					</div>
				</div>
				<div class="yf-letter-input">
					<button class="yf-letter-btn Ajax_submit_btn">发送</button>
				</div>
			</form>
		</div>
	</div>
</div>
<script src="__JS__/jquery.form.min.js"></script>
<script>
$(function(){
	$('.yf-list-body').on({ 
	    mouseenter: function() { 
	    	$(this).addClass("yf-background").find('.yf-list-del').show();
	    }, 
	    mouseleave: function() { 
	    	$(this).removeClass("yf-background").find('.yf-list-del').hide();
	    }
	}, '.yf-list-box');

	$('.yf-write').click(function(e){
		e.preventDefault();
		$('.yf-full').show();
		$('.yf-letter-window').show();
	});

	$('.yf-letter-hide').click(function(ev){
		ev.preventDefault();
		$('.yf-full').hide();
		$('.yf-letter-window').hide();
	});

	$('.yf-list-del').click(function(e){
		e.preventDefault();
		var _this = $(this);
		var ids = _this.attr('data-id');
		var types = _this.attr('data-type');
		send_msg(ids, types);
	});
	
	var id = new Array();
	var type = new Array();
	$('.yf-del-btn').click(function(e){
		e.preventDefault();
		$('.yf-list-del').each(function(){
			var temp_id = $(this).attr('data-id');
			id.push(temp_id);
			var temp_type = $(this).attr('data-type');
			type.push(temp_type);
		});
		
		$('.yf-full').show();
		$('.yf-del-window').show();
	});

	$('.yf-del-btn-y').click(function(ev){
		ev.preventDefault();
		send_msg(id, type);
	});

	$('.yf-del-btn-n').click(function(et){
		et.preventDefault();
		$('.yf-full').hide();
		$('.yf-del-window').hide();
		id = [];
		type = [];
	});

	$('.yf-del-hide').click(function(ee){
		ee.preventDefault();
		$('.yf-full').hide();
		$('.yf-del-window').hide();
		id = [];
		type = [];
	});

	function send_msg(yid, ytype)
	{
		var url = "__WEBURL__/user/index/msgdel";
		$.post(url, { yid:yid,ytype:ytype }, function(res){
			if(res.status == 1)
			{
				$.tipMessage(res.info, 1, 5000, 0, function(){
                   	location.reload();
                });
			}
			else
			{
				$.tipMessage(res.info, 3, 5000);
			}
		}, 'json');
	}
});
</script>